23#include "ceres/ceres.h"
24#include "glog/logging.h"
28#include "yaml-cpp/yaml.h"
65 SolverCeres(
const ProblemPtr& _wolf_problem,
const YAML::Node& _params);
85 bool failed()
const override;
107 bool checkDerived(std::string prefix =
"")
const override;
134 const LocalParametrizationBasePtr& local_param)
const override;
Ceres manifold of a wolf local parametrization.
Definition: manifold_wrapper.h:36
Solver manager using Ceres Solver.
Definition: solver_ceres.h:43
bool isFactorRegisteredDerived(const FactorBasePtr &fac_ptr) const override
Returns whether a factor is in the derived solver.
Definition: solver_ceres.h:159
bool hasThisLocalParametrizationDerived(const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const override
Returns whether a state block has a given local parametrization in the derived solver.
Definition: solver_ceres.cpp:907
SolverCeres(const ProblemPtr &_wolf_problem, const YAML::Node &_params)
Constructor from the problem and the YAML parameters.
Definition: solver_ceres.cpp:29
virtual int numFactorsDerived() const override
Returns the number of factors in the derived solver.
Definition: solver_ceres.h:181
bool failed() const override
Returns whether the last solve failed.
Definition: solver_ceres.cpp:687
ceres::Solver::Summary getSummary() const
Returns the summary of the last solve.
Definition: solver_ceres.h:144
virtual int sizeFactorsDerived() const override
Returns the total residual size of the factors in the derived solver.
Definition: solver_ceres.h:186
ceres::Solver::Options solver_options_
Ceres solver options.
Definition: solver_ceres.h:141
bool wasStopped() const override
Returns whether the last solve was stopped (interrupted by a problem change)
Definition: solver_ceres.cpp:682
unsigned int n_no_convergence_
Solves terminated without convergence.
Definition: solver_ceres.h:60
bool isStateBlockFixedDerived(const StateBlockPtr &st) const override
Returns whether a state block is fixed in the derived solver.
Definition: solver_ceres.h:170
unsigned int n_interrupted_
Solves terminated by interruption.
Definition: solver_ceres.h:59
bool converged() const override
Returns whether the last solve converged.
Definition: solver_ceres.cpp:677
void printProfilingDerived(std::ostream &_stream) const override
Prints the profiling of the derived solver.
Definition: solver_ceres.cpp:915
double initialCost() const override
Returns the initial cost of the last solve.
Definition: solver_ceres.cpp:698
virtual int sizeStateBlocksEstimatedDerived() const override
Returns the total size of the estimated state blocks in the derived solver.
Definition: solver_ceres.cpp:667
bool isStateBlockRegisteredDerived(const StateBlockPtr &state_ptr) const override
Returns whether a state block is in the derived solver.
Definition: solver_ceres.h:164
unsigned int n_iter_max_
Maximum iterations of a single solve.
Definition: solver_ceres.h:57
unsigned int n_iter_acc_
Accumulated iterations of all solves.
Definition: solver_ceres.h:56
bool checkDerived(std::string prefix="") const override
Checks the consistency of the derived solver.
Definition: solver_ceres.cpp:721
void removeFactorDerived(const FactorBasePtr &fac_ptr) override
Removes a factor from the derived solver.
Definition: solver_ceres.cpp:564
~SolverCeres() override
Definition: solver_ceres.cpp:103
std::map< StateBlockPtr, ManifoldWrapperPtr > state_blocks_manifold_
Ceres manifold of each state block.
Definition: solver_ceres.h:49
bool computeCovariancesDerived(CovarianceBlocksToBeComputed _blocks=CovarianceBlocksToBeComputed::ROBOT_LANDMARKS) override
Computes the covariances of the specified blocks in the derived solver.
Definition: solver_ceres.cpp:152
const Eigen::SparseMatrixd computeHessian() const
Computes the Hessian (JᵀJ) of the problem at the current estimate.
Definition: solver_ceres.cpp:840
std::map< FactorBasePtr, ceres::CostFunctionPtr > fac_2_costfunction_
Ceres cost function of each factor.
Definition: solver_ceres.h:46
double finalCost() const override
Returns the final cost of the last solve.
Definition: solver_ceres.cpp:703
std::unique_ptr< ceres::Problem > ceres_problem_
Ceres problem.
Definition: solver_ceres.h:52
virtual int numStateBlocksEstimatedDerived() const override
Returns the number of estimated state blocks in the derived solver.
Definition: solver_ceres.cpp:657
std::unique_ptr< ceres::Covariance > covariance_
Ceres covariance.
Definition: solver_ceres.h:53
ceres::Solver::Summary summary_
Summary of the last solve.
Definition: solver_ceres.h:51
void updateStateBlockLocalParametrizationDerived(const StateBlockPtr &state_ptr) override
Updates the local parametrization of a state block in the derived solver.
Definition: solver_ceres.cpp:623
std::map< FactorBasePtr, ceres::ResidualBlockId > fac_2_residual_idx_
Ceres residual block of each factor.
Definition: solver_ceres.h:45
bool hasLocalParametrizationDerived(const StateBlockPtr &st) const override
Returns whether a state block has a local parametrization in the derived solver.
Definition: solver_ceres.h:176
void addFactorDerived(const FactorBasePtr &fac_ptr) override
Adds a factor to the derived solver.
Definition: solver_ceres.cpp:532
void updateStateBlockStatusDerived(const StateBlockPtr &state_ptr) override
Updates the fixed/unfixed status of a state block in the derived solver.
Definition: solver_ceres.cpp:612
unsigned int iterations() const override
Returns the number of iterations of the last solve.
Definition: solver_ceres.cpp:692
WOLF_SOLVER_CREATE(SolverCeres)
double totalTime() const override
Returns the total time of the last solve.
Definition: solver_ceres.cpp:708
ceres::Solver::Options & getSolverOptions()
Returns the ceres solver options.
Definition: solver_ceres.h:154
void removeStateBlockDerived(const StateBlockPtr &state_ptr) override
Removes a state block from the derived solver.
Definition: solver_ceres.cpp:601
unsigned int n_convergence_
Solves terminated by convergence.
Definition: solver_ceres.h:58
void addStateBlockDerived(const StateBlockPtr &state_ptr) override
Adds a state block to the derived solver.
Definition: solver_ceres.cpp:577
std::string solveDerived(const ReportVerbosity report_level) override
Solves the problem in the derived solver, returning the report.
Definition: solver_ceres.cpp:123
ceres::CostFunctionPtr createCostFunction(const FactorBasePtr &_fac_ptr)
Creates the ceres cost function of a factor, depending on its Jacobian method.
Definition: solver_ceres.cpp:713
std::unique_ptr< ceres::Problem > & getCeresProblem()
Returns the ceres problem.
Definition: solver_ceres.h:149
Solver manager for WOLF.
Definition: solver_manager.h:84
CovarianceBlocksToBeComputed
Enumeration of covariance blocks to be computed.
Definition: solver_manager.h:89
const double * getAssociatedMemBlockPtr(const StateBlockPtr &state_ptr) const
Returns a pointer to the state vector of a registered state block used by the solver.
Definition: solver_manager.cpp:509
std::map< StateBlockPtr, Eigen::VectorXd > state_blocks_
Registered state blocks and solver states.
Definition: solver_manager.h:297
ReportVerbosity
Enumeration for the verbosity of the solver report.
Definition: solver_manager.h:102
SparseMatrix< double > SparseMatrixd
Sparse matrix of real double type.
Definition: wolf.h:109
Definition: solver_ceres.h:31
std::shared_ptr< CostFunction > CostFunctionPtr
Definition: solver_ceres.h:32
Definition: capture_base.h:23
WOLF_PTR_TYPEDEFS(CaptureLandmarksExternal)